<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- header -->
    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <link rel="stylesheet" href="<s:url value="/assets/css/main.css"></s:url>"/>
</head>
<style>
    body {
        background: #fff;
    }

    p {
        margin-top: 8px;
    }

    .information2 {
        border: 1px solid #ccc;
        padding-top: 8px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .FeedbackContent1 {
        cursor: pointer !important;
    }

    .FeedbackContent2 {
        cursor: pointer !important;
    }

    .FeedbackContent3 {
        cursor: pointer !important;
    }
</style>
<body>

<%--上传成功模态框--%>
<div class="shade" style="display: none;"></div>
<div class="warning" style="display: none;">
    <p class="title"><em></em><span class="close">X</span></p>
    <p class="cont"></p>
    <div class="la-square-jelly-box la-3x">
        <div></div>
        <div></div>
    </div>
</div>
<%--催办--%>
<div class="modal fade" id="UrgeModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
     data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">催办</h4></div>
            <div class="modal-body ">
                <div class="information">
                    <div class="form-group clearfix">
                        <label class="control-label col-sm-2 text-right">姓名</label>
                        <div class="col-sm-9">
                            <input type="text" class="Modelname form-control" readonly>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label col-sm-2 text-right">电话</label>
                        <div class="col-sm-9">
                            <input type="text" class="Modelphone form-control" readonly>
                        </div>
                    </div>
                </div>
                <div class="form-group clearfix">
                    <div class="col-sm-offset-2 col-sm-6">
                        <input type="checkbox" value="1" name="type">推送主要领导
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="control-label col-sm-2 text-right">常用语句</label>
                    <div class="col-sm-9">
                        <select class="form-control">
                            <option value=" ">点击选择</option>
                            <option>速度办理</option>
                            <option>及时办理</option>
                        </select>
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="control-label col-sm-2 text-right">催办内容</label>
                    <div class="col-sm-9">
                        <textarea rows="3" class="form-control" vlaue=" "
                                  style="resize: vertical;min-height: 50px"></textarea>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success UrgeSure" data-dismiss="modal">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<form:form commandName="taskMain" cssClass="form-horizontal" role="form" onsubmit="return false"
           enctype="multipart/form-data" id="updateForm">
    <div class="col-sm-offset-1 row">
        <div class="form-group">
            <label class="control-label col-sm-1 no-padding-right">任务名称</label>
            <div class="col-sm-8">
                <input type="text" value="${taskMain.mainName}" class="form-control" readonly>
            </div>
        </div>
        <c:if test="${not empty taskMain.content}">
            <div class="form-group">
                <label class="control-label col-sm-1 no-padding-right">任务内容</label>
                <div class="col-sm-8">
                    <input type="text" value="${taskMain.content}" class="form-control" readonly>
                </div>
            </div>
        </c:if>
        <div class="form-group">
            <label class="control-label col-sm-1 no-padding-right">子事项</label>
            <div class="col-sm-8">
                <input type="text" value="${taskUnit.taskSubName}" class="form-control" readonly>
            </div>
        </div>
            <%--<div class="form-group">--%>
            <%--<label class="control-label col-sm-1 no-padding-right">任务附件</label>--%>
            <%--<c:if test="${not empty taskMain.files}">--%>
            <%--<c:forEach items="${taskMain.files}" var="fileMap">--%>
            <%--${fileMap.file}--%>
            <%--</c:forEach>--%>
            <%--&lt;%&ndash;<div class="col-sm-8">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<input type="text" readonly value="${taskMain.fileName}">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<button class="btn btn-success" FileSysId ="${taskMain.file}" onclick="download(this)"><span&ndash;%&gt;--%>
            <%--&lt;%&ndash;class="glyphicon glyphicon-save"></span>下载附件&ndash;%&gt;--%>
            <%--&lt;%&ndash;</button>&ndash;%&gt;--%>
            <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
            <%--</c:if>--%>
            <%--<c:if test="${empty taskMain.file}">--%>
            <%--<div class="col-sm-8">--%>
            <%--<input type="text" value="无任务附件" class="form-control" readonly>--%>
            <%--</div>--%>
            <%--</c:if>--%>
            <%--</div>--%>
            <%--循环附件下载--%>
        <div class="form-group">
            <label class="control-label col-sm-1 no-padding-right">附件:</label>
            <div class="col-sm-8">
                <c:if test="${not empty taskMain.files}">
                    <c:forEach items="${taskMain.files}" var="fileMap">
                        <div style="margin-bottom:15px;">
                            <input style="width: 70%;" type="text" class="fileName" readonly title="${fileMap.fileName}"
                                   value="${fileMap.fileName}" onclick="copyFile(this)">
                            <button class="btn btn-primary file" onclick="download(this)" FileSysId="${fileMap.file}">
                                下载附件
                            </button>
                        </div>
                    </c:forEach>
                </c:if>
                <c:if test="${empty taskMain.files}">
                    <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                </c:if>
            </div>
        </div>
            <%-----以上为附件下载----%>
        <div class="form-group">
            <label class="control-label col-sm-1 no-padding-right">牵头单位</label>
            <div class="col-sm-8">
                <input type="text" value="${leadDepts}" class="form-control" readonly>
            </div>
        </div>
        <c:forEach items="${xbDeptList}" var="xbDept">
            <div class="form-group">
                <label class="control-label col-sm-1 no-padding-right">协办单位</label>
                <c:if test="${taskUnit.unitType !='1'}">
                    <div class="col-sm-8">
                        <input type="text" value="${xbDept.deptName}" class="form-control" readonly>
                    </div>
                </c:if>
                <c:if test="${taskUnit.unitType=='1'}">
                    <div class="col-sm-6">
                        <input type="text" value="${xbDept.deptName}" class="form-control" readonly>
                    </div>
                    <div class="col-sm-2">
                        <button class="btn btn-sm btn-info assist" taskUnitSysId="${xbDept.sysId}">查看</button>
                        <button class="btn btn-sm btn-info urge" taskUnitSysId="${xbDept.sysId}">催办</button>
                    </div>
                </c:if>
            </div>
        </c:forEach>
        <c:if test="${sysLogin.roleId != '04'}">
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-1 row ">
                    <c:if test="${not empty taskUserList}">
                        <p>我的批转:</p>
                        <div class="information2 row">
                            <c:forEach items="${taskUserList}" var="taskUser">
                                <div class="form-group row">
                                    <div class="form-group">
                                        <label class="control-label col-sm-2">经办人:</label>
                                        <div class="col-sm-3">
                                            <input type="text" class="form-control" value="${taskUser.userName}"
                                                   readonly>
                                        </div>
                                        <label class="control-label col-sm-1">状态:</label>
                                        <div class="col-sm-3">
                                            <input type="text" class="form-control"
                                                   value=" ${taskUser.status == 0 ? "待签收" : taskUser.status == 1 ? "已批转" : taskUser.status == 2 ? "已反馈" : taskUser.status == 3 ? "退回重办" : taskUser.status == 4 ? "完成" : taskUser.status == 5 ? "已签收" : "未知"}"
                                                   readonly>
                                        </div>
                                        <div class="col-sm-1">
                                            <c:if test="${taskUser.status != 4}">
                                                <div class="col-sm-1 col-sm-offset-2">
                                                    <input type="button" value="删除" sysId="${taskUser.sysId}"
                                                           onclick="failureStatus('5',this)"
                                                           class="btn btn-danger btn-sm failure">
                                                </div>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </c:forEach>
                        </div>
                    </c:if>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-1">
                            <button class="btn btn-info btn-sm" id="Approval">批转</button>
                        </div>
                    </div>
                </div>
            </div>
        </c:if>
        <div class="form-group">
            <div class="col-sm-8 col-sm-offset-1 row" id="Handle" style="display: none">
                <div class="information2 row">
                    <div>
                        <div id="Handles">
                            <div class="form-group">
                                <label class="col-sm-1 col-sm-offset-1 control-label">经办人</label>
                                <div class="col-sm-9">
                                    <select name="" multiple="true" id="e1" onchange="addHandle(this)">
                                        <option value="">请选择经办人</option>
                                    </select>
                                    <input type="hidden" value="">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-offset-3 col-sm-1">
                            <button class="btn btn-info btn-sm" onclick="ApprovalConfirm(this)">确定</button>
                        </div>
                        <div class="col-sm-offset-4 col-sm-1">
                            <button class="btn btn-info btn-sm" onclick="Handleremove();">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <c:if test="${not empty myBackList}">
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-1 row uploadList">
                    <p>我的反馈:</p>
                    <c:forEach items="${myBackList}" var="myBack">
                        <div class="information2 row">
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">反馈日期:</label>
                                <div class="col-sm-4">
                                        <%--<c:if test="${!empty myBack.recipientId}">--%>
                                        <%--<input type="text" class="form-control" value=" ${myBack.recipientName}" readonly>--%>
                                        <%--</c:if>--%>
                                        <%--<c:if test="${empty myBack.recipientId}">--%>
                                        <%--<input type="text" class="form-control" value=" ${myBack.receiveDeptName}" readonly>--%>
                                        <%--</c:if>--%>
                                    <input type="text" class="form-control" value=" ${myBack.createDate}" readonly>
                                </div>
                                <label class="control-label col-sm-1">反馈时间:</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control"
                                           value=" ${myBack.createTime}" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                    <%--<label class="control-label col-sm-offset-1 col-sm-1">附件:</label>--%>
                                    <%--<div class="col-sm-4">--%>
                                    <%--<c:if test="${not empty myBack.file}">--%>
                                    <%--<input type="text" readonly value="${myBack.fileName}">--%>
                                    <%--<button class="btn btn-primary" onclick="download(this)" FileSysId ="${myBack.file}">--%>
                                    <%--下载附件--%>
                                    <%--</button>--%>
                                    <%--&lt;%&ndash;</c:if>&ndash;%&gt;--%>
                                    <%--<c:if test="${empty myBack.file}">--%>
                                    <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                                    <%--</c:if>--%>
                                    <%--</div>--%>
                                <label class="control-label col-sm-offset-1  col-sm-1">反馈状态:</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control"
                                           value="${myBack.status == 0 ? "未处理" :myBack.status == 1 ? "合格" : myBack.status == 2 ? "退回重办" :myBack.status == 3 ? "已反馈" : "未知"}"
                                           readonly>
                                </div>
                            </div>
                                <%--循环附件下载--%>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                <div class="col-sm-9">
                                    <c:if test="${not empty myBack.files}">
                                        <c:forEach items="${myBack.files}" var="fileMap">
                                            <div style="margin-bottom:15px;">
                                                <input style="width: 70%;" type="text" class="fileName" readonly
                                                       title="${fileMap.fileName}"
                                                       value="${fileMap.fileName}" onclick="copyFile(this)">
                                                <button class="btn btn-primary file" onclick="download(this)"
                                                        FileSysId="${fileMap.file}">
                                                    下载附件
                                                </button>
                                            </div>
                                        </c:forEach>
                                    </c:if>
                                    <c:if test="${empty myBack.files}">
                                        <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                    </c:if>
                                </div>
                            </div>
                                <%-----以上为附件下载----%>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent1" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${myBack.content}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                <div class="col-sm-9">
                                            <textarea rows="3" readonly class="form-control FeedbackContent2"
                                                      title="点击复制" style="resize: vertical;min-height: 50px"
                                                      type="text">${myBack.problem}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                <div class="col-sm-9">
                                            <textarea rows="3" readonly class="form-control FeedbackContent3"
                                                      title="点击复制" style="resize: vertical;min-height: 50px"
                                                      type="text">${myBack.plan}</textarea>
                                </div>
                            </div>
                            <h4 class="redTips col-sm-offset-2">温馨提示：点击反馈内容框可赋值内容</h4>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </c:if>
        <c:if test="${ taskUnit.unitType=='1'}">
            <c:if test="${not empty giveDeptBackList}">
                <div class="form-group">
                    <div class="col-sm-8 col-sm-offset-1 row uploadList">
                        <p>协办单位反馈:</p>
                        <c:forEach items="${giveDeptBackList}" var="giveDeptBack">
                            <div class="information2 row">
                                    <%--<div class="form-group">--%>
                                    <%--<label class="control-label col-sm-offset-1 col-sm-1">反馈单位:</label>--%>
                                    <%--<div class="col-sm-5">--%>
                                    <%--<input type="text" class="form-control" value="${giveDeptBack.deptName}" readonly>--%>
                                    <%--</div>--%>
                                    <%--</div>--%>
                                <div class="form-group">
                                    <label class="control-label col-sm-offset-1 col-sm-1">反馈人:</label>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control" value="${giveDeptBack.senderName}"
                                               readonly>
                                    </div>
                                    <label class="control-label col-sm-1">反馈时间:</label>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control"
                                               value="${giveDeptBack.createDate} ${giveDeptBack.createTime}" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                        <%--<label class="control-label col-sm-offset-1 col-sm-1">附件:</label>--%>
                                        <%--<div class="col-sm-4">--%>
                                        <%--<c:if test="${not empty giveDeptBack.file}">--%>
                                        <%--<input type="text" readonly value="${giveDeptBack.fileName}">--%>
                                        <%--<button class="btn btn-primary" onclick="download(this)"  FileSysId="${giveDeptBack.file}">--%>
                                        <%--下载附件--%>
                                        <%--</button>--%>
                                        <%--</c:if>--%>
                                        <%--<c:if test="${empty giveDeptBack.file}">--%>
                                        <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                                        <%--</c:if>--%>
                                        <%--</div>--%>
                                    <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control"
                                               value="${giveDeptBack.status == 0 ? "未处理" :giveDeptBack.status == 1 ? "合格" : giveDeptBack.status == 2 ? "退回重办" :giveDeptBack.status == 3 ? "已反馈" : "未知"}"
                                               readonly>
                                    </div>
                                </div>
                                    <%--循环附件下载--%>
                                <div class="form-group">
                                    <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                    <div class="col-sm-9">
                                        <c:if test="${not empty giveDeptBack.files}">
                                            <c:forEach items="${giveDeptBack.files}" var="fileMap">
                                                <div style="margin-bottom:15px;">
                                                    <input style="width: 70%;" type="text" class="fileName" readonly
                                                           title="${fileMap.fileName}"
                                                           value="${fileMap.fileName}" onclick="copyFile(this)">
                                                    <button class="btn btn-primary file" onclick="download(this)"
                                                            FileSysId="${fileMap.file}">
                                                        下载附件
                                                    </button>
                                                </div>
                                            </c:forEach>
                                        </c:if>
                                        <c:if test="${empty giveDeptBack.files}">
                                            <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                        </c:if>
                                    </div>
                                </div>
                                    <%-----以上为附件下载----%>
                                <div class="form-group">
                                    <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                    <div class="col-sm-9">
                                    <textarea rows="3" readonly class="form-control FeedbackContent1" title="点击复制"
                                              style="resize: vertical;min-height: 50px"
                                              type="text">${giveDeptBack.content}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                    <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent2" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${giveDeptBack.problem}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                    <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent3" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${giveDeptBack.plan}</textarea>
                                    </div>
                                </div>
                                <h4 class="redTips col-sm-offset-2">温馨提示：点击反馈内容框可赋值内容</h4>
                                <c:if test="${sysLogin.roleId == '02'}">
                                    <c:if test="${giveDeptBack.status != '2'}">
                                        <div class="row">
                                            <div class="col-sm-offset-2 col-sm-6">
                                                    <%--<button class="btn btn-info btn-sm clickFeedback">直接反馈</button>--%>
                                                <button class="btn btn-info btn-sm updateStatus"
                                                        updateStatus='${giveDeptBack.sysId}'>退回重办
                                                </button>
                                            </div>
                                        </div>
                                    </c:if>
                                </c:if>
                            </div>
                        </c:forEach>
                    </div>
                </div>
            </c:if>
        </c:if>
        <c:if test="${not empty giveMeBackList}">
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-1 row uploadList">
                    <p>反馈我的:</p>
                    <c:forEach items="${giveMeBackList}" var="giveMe">
                        <div class="information2 row">
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">反馈人:</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" value="${giveMe.senderName}" readonly>
                                </div>
                                <label class="control-label col-sm-1">反馈时间:</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control"
                                           value="${giveMe.createDate} ${giveMe.createTime}" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                    <%--              <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                  <div class="col-sm-4">
                                                      <c:if test="${not empty giveMe.files}">
                                                          <c:forEach items="${giveMe.files}" var="fileMap">
                                                              ${fileMap.file}
                                                               <input type="text" class="fileName" readonly value="${fileMap.fileName}" onclick="copyFile(this)">
                                                          <button class="btn btn-primary file" onclick="download(this)" FileSysId = "${fileMap.file}">
                                                              下载附件
                                                          </button>
                                                          </c:forEach>

                                                      </c:if>
                                                      <c:if test="${empty giveMe.file}">
                                                          <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                                      </c:if>
                                                  </div>--%>
                                <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control"
                                           value="${giveMe.status == 0 ? "未处理" :giveMe.status == 1 ? "合格" : giveMe.status == 2 ? "退回重办" :giveMe.status == 3 ? "已反馈" : "未知"}"
                                           readonly>
                                </div>
                            </div>
                                <%--循环附件下载--%>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                <div class="col-sm-9">
                                    <c:if test="${not empty giveMe.files}">
                                        <c:forEach items="${giveMe.files}" var="fileMap">
                                            <div style="margin-bottom:15px;">
                                                <input style="width: 70%;" type="text" class="fileName" readonly
                                                       title="${fileMap.fileName}"
                                                       value="${fileMap.fileName}" onclick="copyFile(this)">
                                                <button class="btn btn-primary file" onclick="download(this)"
                                                        FileSysId="${fileMap.file}">
                                                    下载附件
                                                </button>
                                            </div>
                                        </c:forEach>
                                    </c:if>
                                    <c:if test="${empty giveMe.files}">
                                        <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                    </c:if>
                                </div>
                            </div>
                                <%-----以上为附件下载----%>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent1" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${giveMe.content}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent2" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${giveMe.problem}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent3" title="点击复制"
                                          style="resize: vertical;min-height: 50px"
                                          type="text">${giveMe.plan}</textarea>
                                </div>
                            </div>
                            <h4 class="redTips col-sm-offset-2">温馨提示：点击反馈内容框可赋值内容</h4>
                            <c:if test="${giveMe.status != '2'}">
                                <div class="row">
                                    <div class="col-sm-offset-2 col-sm-6">
                                        <button class="btn btn-info btn-sm clickFeedback">直接反馈</button>
                                        <button class="btn btn-info btn-sm updateStatus" updateStatus='${giveMe.sysId}'>
                                            退回重办
                                        </button>
                                    </div>
                                </div>
                            </c:if>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </c:if>
        <div class="form-group">
            <div class="col-sm-8 col-sm-offset-1 row" id="Feedback">
                <div class="information2 row">
                    <div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">办理情况</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent1"
                                              placeholder="请输入办理情况"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">存在问题</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent2"
                                              placeholder="请输入存在问题"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">下一步计划</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent3"
                                              placeholder="请输入下一步计划"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">反馈附件</label>
                                    <%--<div class="col-sm-7 pos-rel">--%>
                                <div class="col-sm-9">
                                    <div id="uploader"></div>
                                        <%--<input type="file" class="form-control" id="fileupload">--%>
                                </div>
                                    <%--<div class="col-sm-2">--%>
                                    <%--<button class="btn btn-info" onclick="uploadFile(this,'file','fileName')">--%>
                                    <%--<span class="glyphicon glyphicon-open"></span>上传附件--%>
                                    <%--</button>--%>
                                    <%--</div>--%>
                            </div>
                        </div>
                        <c:if test="${taskUnit.unitType == '2'}">
                            <c:if test="${sysLogin.roleId == '02'}">
                                <input type="hidden" id="recipientId" value="${taskUnit.taskSubId}">
                            </c:if>
                            <c:if test="${sysLogin.roleId == '03' or sysLogin.roleId == '04' }">
                                <input type="hidden" id="recipientId" value="${userCreate}">
                            </c:if>
                        </c:if>
                        <c:if test="${taskUnit.unitType == '1'}">
                            <c:if test="${sysLogin.roleId == '02'}">
                                <input type="hidden" id="recipientId" value="${mainCreateUser}">
                            </c:if>
                        </c:if>
                        <c:if test="${sysLogin.roleId == '03' or sysLogin.roleId == '04' }">
                            <input type="hidden" id="recipientId" value="${userCreate}">
                        </c:if>
                    </div>
                    <div class="row">
                        <div class="col-sm-offset-3 col-sm-1">
                            <button class="btn btn-info btn-sm FeedbackConfirm" onclick="FeedbackConfirm()">确定</button>
                        </div>
                        <div class="col-sm-offset-4 col-sm-1">
                            <button class="btn btn-info btn-sm ">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <c:if test="${not empty oldTask}">
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-1 row uploadList">
                    <p>历史记录:</p>
                    <div class="information2 row">
                        <c:forEach items="${oldTask}" var="old" varStatus="oldindex">
                            <div class="form-group" style="margin: 0">
                                <div class="panel panel-default ">
                                    <div class="panel-heading">
                                        <h4 class="panel-title">
                                            <a data-toggle="collapse" data-parent="#accordion"
                                               href="#collapse${oldindex.index}">
                                                第${old.taskUnit.timeRound}轮任务
                                            </a>
                                        </h4>
                                    </div>
                                    <div id="collapse${oldindex.index}" class="panel-collapse collapse">
                                        <div class="panel-body">
                                            <c:forEach items="${old.backNewList}" var="backNew">
                                                <c:choose>
                                                    <c:when test="${backNew.createUser == sysLogin.sysId}">
                                                        <h6>我反馈的</h6>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">反馈日期:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value=" ${backNew.createDate}" readonly>
                                                            </div>
                                                            <label class="control-label col-sm-1">反馈时间:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value=" ${backNew.createTime}" readonly>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                           <%-- <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                            <div class="col-sm-4">
                                                                <c:if test="${not empty backNew.file}">
                                                                    <input type="text" readonly
                                                                           value="${backNew.fileName}">
                                                                    <button class="btn btn-primary"
                                                                            onclick="download(this)"
                                                                            FileSysId="${backNew.file}">
                                                                        下载附件
                                                                    </button>
                                                                </c:if>
                                                                <c:if test="${empty backNew.file}">
                                                                    <input type="text" value="无附件"
                                                                           class=" col-sm-3 form-control" readonly>
                                                                </c:if>
                                                            </div>--%>
                                                            <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value="${backNew.status == 0 ? "未处理" :backNew.status == 1 ? "合格" : backNew.status == 2 ? "退回重办" :backNew.status == 3 ? "已反馈" : "未知"}"
                                                                       readonly>
                                                            </div>
                                                        </div>
                                                        <%--循环附件下载--%>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                            <div class="col-sm-9">
                                                                <c:if test="${not empty backNew.files}">
                                                                    <c:forEach items="${backNew.files}" var="fileMap">
                                                                        <div style="margin-bottom:15px;">
                                                                            <input style="width: 70%;" type="text" class="fileName" readonly
                                                                                   title="${fileMap.fileName}"
                                                                                   value="${fileMap.fileName}" onclick="copyFile(this)">
                                                                            <button class="btn btn-primary file" onclick="download(this)"
                                                                                    FileSysId="${fileMap.file}">
                                                                                下载附件
                                                                            </button>
                                                                        </div>
                                                                    </c:forEach>
                                                                </c:if>
                                                                <c:if test="${empty backNew.files}">
                                                                    <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                                                </c:if>
                                                            </div>
                                                        </div>
                                                        <%-----以上为附件下载----%>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.content}</textarea>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.problem}</textarea>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.plan}</textarea>
                                                            </div>
                                                        </div>
                                                        <hr/>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <h6>反馈我的</h6>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">反馈人:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value="${backNew.senderName}" readonly>
                                                            </div>
                                                            <label class="control-label col-sm-1">反馈时间:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value="${backNew.createDate} ${backNew.createTime}"
                                                                       readonly>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                                <%--<div class="col-sm-4">--%>
                                                                <%--<c:if test="${not empty backNew.file}">--%>
                                                                <%--<input type="text" readonly value="${backNew.fileName}">--%>
                                                                <%--<button class="btn btn-primary" onclick="download(this)" FileSysId="${backNew.file}">--%>
                                                                <%--下载附件--%>
                                                                <%--</button>--%>
                                                                <%--</c:if>--%>
                                                                <%--<c:if test="${empty backNew.file}">--%>
                                                                <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                                                                <%--</c:if>--%>
                                                                <%--</div>--%>
                                                            <label class="control-label col-sm-1">反馈状态:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value="${backNew.status == 0 ? "未处理" :backNew.status == 1 ? "合格" : backNew.status == 2 ? "退回重办" :backNew.status == 3 ? "已反馈" : "未知"}"
                                                                       readonly>
                                                            </div>
                                                        </div>
                                                        <%--循环附件下载--%>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                            <div class="col-sm-9">
                                                                <c:if test="${not empty backNew.files}">
                                                                    <c:forEach items="${backNew.files}" var="fileMap">
                                                                        <div style="margin-bottom:15px;">
                                                                            <input style="width: 70%;" type="text" class="fileName" readonly
                                                                                   title="${fileMap.fileName}"
                                                                                   value="${fileMap.fileName}" onclick="copyFile(this)">
                                                                            <button class="btn btn-primary file" onclick="download(this)"
                                                                                    FileSysId="${fileMap.file}">
                                                                                下载附件
                                                                            </button>
                                                                        </div>
                                                                    </c:forEach>
                                                                </c:if>
                                                                <c:if test="${empty backNew.files}">
                                                                    <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                                                                </c:if>
                                                            </div>
                                                        </div>
                                                        <%-----以上为附件下载----%>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.content}</textarea>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.problem}</textarea>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                                            <div class="col-sm-9">
                                                    <textarea rows="3" readonly class="form-control " title="点击复制"
                                                              style="resize: vertical;min-height: 50px"
                                                              type="text">${backNew.plan}</textarea>
                                                            </div>
                                                        </div>
                                                        <hr/>
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:forEach>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </c:forEach>
                    </div>
                </div>
            </div>
        </c:if>
        <div class="form-group">
            <label class="col-sm-1 text-right control-label">流程记录:</label>
            <div class="col-sm-9" style="margin-top: 30px">
                <c:forEach var="logNew" items="${logNewList}" varStatus="num">
                    <div class="row" style="margin-bottom: 5px">
                        <div class="col-sm-11"><span style="font-weight: bold;margin-right: 20px">${num.count}.</span>
                            <span style="font-weight: normal;margin-right: 20px"> ${logNew.createDate} ${logNew.createTime} </span>
                            <span style="font-weight: normal"> ${logNew.content}</span></div>
                            <%--<button class="btn-sm btn btn-info col-sm-1 urge" btnSysId = "${logNew.sysId}">催办</button>--%>
                    </div>
                </c:forEach>
            </div>
        </div>
        <input type="hidden" id="sysId" value="${taskUnit.sysId}">
        <input type="hidden" id="taskSubId" value="${taskUnit.taskSubId}">
    </div>
</form:form>

<%--多选上传--%>
<script src="<s:url value="/assets/js/dist/easyUploader.jq.js"></s:url>"></script>

<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/bootstrap.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"></script>
<script src="<s:url value="/assets/js/date-time/bootstrap-datepicker.js"></s:url>"></script>
<script src="<s:url value="/assets/js/select2.js"></s:url>"></script>
<script src="<s:url value="/assets/js/jquery.gritter.js"></s:url>"></script>
<script src="<s:url value="/assets/js/own.js"></s:url>"></script>

<script>
    <%--多文件上传--%>
    var fileStr = "";//id字符串拼接
    var fileNameStr = "";//文件名字符串拼接
    var uploader = easyUploader({
        id: "uploader",
        accept: '.jpg,.png,.doc,.docx,.pdf,.xls,.xlsx,.ppt,.pptx',
        action: '/filesUpload/uploadFiles',
        dataFormat: 'formData',
        maxCount: 10,//允许上传的个数
        maxSize: 2000,//允许上传最大的容量
        multiple: true,
        data: null,
        beforeUpload: function (file, data, args) {
        },
        onChange: function (fileList) {
        },
        onRemove: function (removedFiles, files) {
            console.log('onRemove', removedFiles);
        },
        onSuccess: function (res) {
            console.log('onSuccess', res);
            if (res.data !== undefined && res.data[0] !== undefined) {
                //拼接文件id 和 文件名
                fileStr += res.data[0].sysid + ",";
                fileNameStr += res.data[0].oldName + ",";
            }
        },
        onError: function (err) {
            console.log('onError', err);
        },
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#e1").select2({
            placeholder: "请输入或点击选择经办人",
            width: "100%",
            closeOnSelect: false,
            allowClear: true,
        });
    });
    /**
     * 获取经办人
     */
    $("#Approval").click(function () {
        $("#Handle").show();
        $.get("/taskUnit/endorseList/" + $("#sysId").val() + "", function (data) {
            var option = "<option></option>"
            for (var i = 0; i < data.length; i++) {
                option += " <option value=" + data[i].sysId + ">" + data[i].name + "</option>"
            }
            $("#e1").html(option);
        })
    });

    function Handleremove() {
        $("#Handle").hide();
    }

    function addHandle(data) {
        $(data).siblings("input").val($(data).val().join(","));
    }

    /**
     *  ApprovalConfirm 批转确定
     */
    function ApprovalConfirm(e) {
        failure($(e), 1)
        var taskUsers = $("#e1").siblings("input").val();
        if (taskUsers == null || taskUsers == "") {
            return alert("请选择经办人");
        }
        var taskSubId = $("#taskSubId").val();
        var sysId = $("#sysId").val();


        var datas = {
            sysId: sysId,
            taskSubId: taskSubId,
            taskUsers: taskUsers,

        };
        $.post("/taskUnit/saveTaskUser", datas, function (data) {
            if (data.code == 200) {
                failure($(e), 0)
                alert(data.message);
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            } else {
                alert(data.message);
            }
        })
    }

    /**
     *反馈人 FeedbackPerson
     */
    (function () {
        var sysId = $("#sysId").val();
        $.get("/taskUnit/backUserList", {taskUnitId: sysId}, function (data) {
            var option = "<option>点击选择</option>"
            for (var i = 0; i < data.length; i++) {
                option += " <option value=" + data[i].userId + ">" + data[i].username + "</option>"
            }
            $(".FeedbackPerson").html(option);
        })
    })();

    /**
     * 动态获取反馈内容
     */
    $(document).on("click", ".FeedbackContent1", function () {
        var html = $("#FeedbackContent1").val();
        var text = $(this).val();
        html += text;
        $("#FeedbackContent1").val(html);

    });
    $(document).on("click", ".FeedbackContent2", function () {
        var html = $("#FeedbackContent2").val();
        var text = $(this).val();
        html += text;
        $("#FeedbackContent2").val(html);

    });
    $(document).on("click", ".FeedbackContent3", function () {
        var html = $("#FeedbackContent3").val();
        var text = $(this).val();
        html += text;
        $("#FeedbackContent3").val(html);

    });

    /**
     *  确认反馈内容
     */

    function FeedbackConfirm() {
        failure(".FeedbackConfirm", 1)
        var FeedbackContent1 = $("#FeedbackContent1").val();
        var FeedbackContent2 = $("#FeedbackContent2").val();
        var FeedbackContent3 = $("#FeedbackContent3").val();
        var sysId = $("#sysId").val();
        var FeedbackName = $("#recipientId").val();
        if (!FeedbackContent1) {
            failure(".FeedbackConfirm", 0)
            return alert("请输入办理情况")
        }

        var datas = {
            content: FeedbackContent1,
            problem: FeedbackContent2, //存在问题
            plan: FeedbackContent3,  //下一步计划
            recipientId: FeedbackName,
            taskUnitId: sysId,
            file: fileStr,
            fileName: fileNameStr
        }
        $.post("/taskUnit/taskBackNew", datas, function (data) {
            if (data.code == 200) {
                alert(data.message);
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            } else {
                alert(data.message);
            }
            failure(",FeedbackConfirm", 0)
        })

    }

    /**
     *  我的反馈状态
     */
    $(".updateStatus").click(function () {
        var $this = $(this);
        var status = 2;
        var taskBackId = $this.attr("updateStatus");
        $.post("/taskUnit/updateStatus", {taskBackId: taskBackId, status: status}, function (data) {
            if (data.code == 200) {
                alert(data.message);
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            } else {
                alert(data.message);
            }
        })
    });


    //    催办
    var userList, rowIds;

    $(document).on("click", ".urge", function () {
        rowIds = $(this).attr("taskUnitSysId");
        $.get("/taskMain/urgeModel/" + rowIds, function (data) {
            userList = data;
            var html = "";
            for (var i = 0; i < data.length; i++) {
                if (data[i].mobile == undefined) {
                    data[i]['mobile'] = ''
                }
                html += " <div class=\"form-group clearfix\">\n" +
                    "                        <label class=\"control-label col-sm-2 text-right\">姓名</label>\n" +
                    "                        <div class=\"col-sm-9\">\n" +
                    "                            <input type=\"text\" class=\"Modelname form-control\" readonly value='" + data[i].name + "'>\n" +
                    "                        </div>\n" +
                    "                    </div>\n" +
                    "                    <div class=\"form-group clearfix\">\n" +
                    "                        <label class=\"control-label col-sm-2 text-right\">电话</label>\n" +
                    "                        <div class=\"col-sm-9\">\n" +
                    "                            <input type=\"text\" class=\"Modelphone form-control\" readonly value='" + data[i].mobile + "'>\n" +
                    "                        </div>\n" +
                    "                    </div>"
            }
            $(".information").html(html);
        });
        $('#UrgeModel').modal('show'); //显示
    });
    $("#UrgeModel select").change(function () {
        $("#UrgeModel textarea").val($(this).val());
    })

    $(".UrgeSure").click(function () {
        failure(".UrgeSure", 1)
        type = $("input[name='type']:checked").val();
        if (!type) {
            type = 0;
        }
        var datas = {
            taskUnitId: rowIds,
            content: $("#UrgeModel textarea").val(),
            userList: userList,
            type: type
        };
        var jsonDatas = JSON.stringify(datas);
        $.ajax({
            url: '/taskMain/saveHasten/',
            type: 'POST',
            contentType: 'application/json; charset=UTF-8',
            async: false,
            dataType: 'json',
            data: jsonDatas,
            success: function (data) {
                if (data.code == "200") {
                    alert("催办成功");
                    $("#UrgeModel textarea").val("");
                    $("input[name='type']").removeAttr("checked");
                } else {
                    alert("催办失败");
                }
                failure(".UrgeSure", 0)
            }
        })
    });
    $(document).on("click", ".assist", function () {
        var sysId = $(this).attr("taskUnitSysId");
        parent.openapp("/taskUnit/showXbTask/" + sysId + "", sysId, "协办详情")
    });

    /*失效 failureStatus*/
    function failureStatus(status, taskUserId) {

        var $taskUserId = $(taskUserId).attr("sysId");
        var question = confirm("确定删除?");
        if (question) {
            $.get("/taskUnit/updateTaskUser/", {taskUserId: $taskUserId}, function (data) {
                alert(data.code == 200 ? "任务已删除" : "任务删除失败");
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            })
        } else {
            alert("删除失败!")
        }


    }

    $(".clickFeedback").click(function () {
        var $parent = $(this).parent().parent().parent();
        var FeedbackContent1 = $parent.find(".FeedbackContent1").val();
        var FeedbackContent2 = $parent.find(".FeedbackContent2").val();
        var FeedbackContent3 = $parent.find(".FeedbackContent3").val();
        var file = $parent.find(".file").attr("FileSysId");
        var filename = $parent.find(".fileName").val();
        var FeedbackName = $("#recipientId").val();
        var sysId = $("#sysId").val();

        var datas = {
            content: FeedbackContent1,
            problem: FeedbackContent2, //存在问题
            plan: FeedbackContent3,  //下一步计划
            recipientId: FeedbackName,
            taskUnitId: sysId,
            file: file,
            fileName: filename
        }
        $.post("/taskUnit/taskBackNew", datas, function (data) {
            if (data.code == 200) {
                alert(data.message);
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            } else {
                alert(data.message);
            }
        })
    });
    // 关闭
    // parent.close_current_app();
</script>
</body>
</html>